<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.ccut.edu.cn/saturn" prefix="saturn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>templete jsp</title>
<%@ include file="/extjs/include/all.jsp"%>
</head>
<body>
<div id='componentPanel' style="widows: 100%"></div>
<div id='paramGridDiv' style="widows: 100%"></div>
<script>
Ext.onReady(function(){
	var store = new Ext.data.JsonStore({
		url:'<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/extComponentModule/action/QueryComponentInfoByFullKey.action',
		root:'componentInfoList',
		fields:[
			{name:'key',mapping:'key'},
			{name:'name',mapping:'name'},
			{name:'class',mapping:'class'},
			{name:'description',mapping:'description'}
		]
	});
	store.load({params:{
		fullKey:'<%=request.getParameter("fullKey")%>'
	}});
	
	
	var paramstore = new Ext.data.JsonStore({
		url:'<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/extComponentModule/action/QueryComponentInfoByFullKey.action',
		root:'componentParamInfoList',
		fields:[
			{name:'id',mapping:'id'},
			{name:'name',mapping:'name'},
			{name:'passingType',mapping:'passingType'},
			{name:'classType',mapping:'classType'},
			{name:'description',mapping:'description'},
			{name:'valueKey',mapping:'valueKey'},
			{name:'scope',mapping:'scope'}
		]
	});
	paramstore.load({params:{
		fullKey:'<%=request.getParameter("fullKey")%>'
	}});
	
	store.on('load', function(){
	       var name ;
	       var key ;
	       var classaa ;
	       var description ;
	   if(store.getAt(0) != null) {
	       name = store.getAt(0).get('name');
	       key = store.getAt(0).get('key');
	       classaa = store.getAt(0).get('class');
	       description = store.getAt(0).get('description');
	   }
	    myPanel(name,key,classaa,description);	    
	});
	
function myPanel(name,key,classaa,description){
Ext.onReady(function(){
	var debugThread = new Ext.FormPanel({
		title:'属性',
		renderTo:'componentPanel',
		frame:true,
		autoHeight:true,
		bodyStyle:'width:100%',
		items:[{
			layout:'form',
			items:[{
				layout:'column',
				items:[{
					columnWidth:.15,
					xtype:'label',
					text:'键值:  '
				},{
					columnWidth:.8,
					xtype:'label',
					text:key
				}]
			},{
				layout:'column',
				items:[{
					columnWidth:.15,
					xtype:'label',
					text:'名称:'
				},{
					columnWidth:.8,
					xtype:'label',
					text:name
				}]
			},{
				layout:'column',
				items:[{
					columnWidth:.15,
					xtype:'label',
					text:'构件类:'
				},{
					columnWidth:.8,
					xtype:'label',
					text:classaa
				}]
			},{
				layout:'column',
				items:[{
					columnWidth:.15,
					xtype:'label',
					text:'描述:'
				},{
					columnWidth:.8,
					xtype:'label',
					text:description
				}]
			}]
		}]
	});
});}

	var resultWidth = Ext.getBody().getWidth();
		var cm = new Ext.grid.ColumnModel([
		new Ext.grid.RowNumberer(),
		{header:'序号',dataIndex:'id',width:resultWidth*.14},
		{header:'名称',dataIndex:'name',width:resultWidth*.14},
		{header:'类型',dataIndex:'classType',width:resultWidth*.14},
		{header:'输入/输出',dataIndex:'passingType',width:resultWidth*.14},
		{header:'表达式',dataIndex:'name',width:resultWidth*.14},
		{header:'数据域',dataIndex:'scope',width:resultWidth*.14},
		{header:'描述',dataIndex:'description',width:resultWidth*.14}
	]);
	
	var paramGrid = new Ext.grid.GridPanel({
		el:'paramGridDiv',
		title:'参数信息',
		stripeRows: true,
	    collapsible:true,
	    trackMouseOver:false, 
	    bodyStyle:'width:100%',
	    loadMask: {msg:'正在加载数据，请稍侯……'}, 
	    autoHeight:true,
		store:paramstore,
		cm:cm
	});
	paramGrid.render();
});
</script>
<script type="text/javascript">
    function getValidates(fullKey,saturnItemName) {
        location = "<%=request.getContextPath()%>/edu.ccut.saturn.manager.bundles.impl::/componentModule/tdValidateAction/GetDataItemValidate.action?fullKey="+fullKey+"&saturnItemName="+saturnItemName;
    }
</script>
</body>
</html>